package hui.zhang.dao.base;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import hui.zhang.domain.base.Area;

public interface AreaRepository extends JpaRepository<Area, String>, 
										JpaSpecificationExecutor<Area> {

	@Query(value="select province from Area group by province")
	List<String> queryProvince();

	@Query("select city from Area where province=? group by city")
	List<String> queryCity(String province);

	@Query("from Area where city=?")
	List<Area> queryDistrict(String city);

	List<Area> findByProvince(String province);
	
	Area findByProvinceAndCityAndDistrict(String province, String city, String district);

}
